package com.xl.controller;

import com.xl.serivce.DownloadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RestController
public class DownloadController {

    @Autowired
    private DownloadService downloadService ;

    @PostMapping("/download")
    public void downLoadFile(@RequestBody List<String> filePaths , HttpServletResponse response){
        System.out.println(response);
        downloadService.download(filePaths);
    }
}
